import opensky.dbcache.dbvp.core.ConfigLoad;
import opensky.dbcache.dbvp.rule.MatchType;
import opensky.dbcache.dbvp.rule.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * User: zhenggm
 * Date: 2017/9/18 下午5:12
 */
public class Italk {
    public static void main(String[] args) throws ParseException {


        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH时mm分ss秒");
        Date date33 = sdf2.parse("2008-08-08 12时10分12秒");

        float 他 = 2;
        Map<String, Object> mapstring = new HashMap<>();
        mapstring.put("name", "1998-09-09");
        mapstring.put("age", 他);
        mapstring.put("city", "北京");

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:MM:ss");
        String date = (String) mapstring.get("name");
        Object result = sdf.parse(date);
        Object value = sdf.parse("2222-11-22 22:22:11");

        Date d1 = (Date) result;
        Date d2 = (Date) value;
        System.out.println(d1.getTime()<d2.getTime());



        Param param = new Param();
        param.setType(MatchType.ISNULL);

        System.out.println(param.getType().equals(MatchType.ISNULL));



        System.out.println(MatchType.GREATER.getCode()+MatchType.ISNULL.getCode());

        Integer i = 2;
        Object w = null;


        w = String.valueOf(i);
        i = Integer.valueOf((String) w);
        System.out.println(i.equals(他));


        if (mapstring.get("213123") == null) {
            System.out.println(1);
        }
        if (mapstring.get("age") == null) {
            System.out.println(2);
        } else {
            System.out.println(3);
        }

        String c = "java.lang.Integer";
        Object result2 = null;
        switch (c) {
            case "java.lang.String":
                result = (String) mapstring.get("name");
                break;
            case "java.lang.Integer":
                result = (Integer) mapstring.get("age");
                break;
        }
    }
}
